'use strict';

module.exports = () => {
  return async (ctx, next) => {
    try {
      // 尝试调用下一步
      await next();
    } catch (error) {
      ctx.status = 400;
      ctx.body = {
        code: 0,
        msg: '接口异常，请稍后再试',
      };
    }
  };
};
